public class TenthFrame extends Frame
{
	private int extraAttempts=2;
	public TenthFrame()
	{
		nextFrame = new Frame();
		nextFrame.nextFrame = new Frame();
		
	}
	public int getAttempts()
	{
		return extraAttempts+super.getAttempts();
	}
	public void useAttempt()
	{
		if(super.getAttempts()==0)
		{
			if(this.isSpare())
				extraAttempts--;
			extraAttempts--;
		}
		else
			super.useAttempt();
	}
	public void bowl(int i)
	{
		if (super.getAttempts() == 0)
		{
			if (nextFrame.availableAttempts == 0)
			{
				nextFrame.nextFrame.bowl(i);
			}
			else
			{
				nextFrame.bowl(i);
			}
			this.useAttempt();
		}
		else
			super.bowl(i);
	}
}
